<template>
    <div>
        <template v-if="props.card == null">
            卡面已被删除
        </template>
        <template v-else-if="lCardType == undefined">
            无法识别该卡面类型{{ props.card?.type }},请搜索该卡面类型并使用导入功能
        </template>
        <template v-else>
            <DefaultPart :id  :card="props.card" :part="lCardType.coverPart"></DefaultPart>
        </template>
    </div>
</template>

<script setup lang="ts">

import cardType from '@/ts/cardType/cardType';
import DefaultPart from './part/DefaultPart.vue';
import { computed } from 'vue';
import { useRoom } from '@/stores/room';
import type card from '@/ts/cardData/card';
const props = defineProps<{
    card?:card,
    cardType?:cardType
    id:string
}>()
const lCardType = computed(() => {
    if (props.cardType != undefined) {
        return props.cardType
    } else {
        return useRoom().getType(props.card?.type)
    }
})
</script>

<style scoped></style>